﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace NormalGsearch
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {

        }

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow window = new MainWindow();
            NormalGSearchViewModel viewModel = (NormalGSearchViewModel)window.DataContext;

            NormalGSearch normalGSearch = NormalGSearch.Instance(viewModel);

            EventHandler handler = null;
            handler = delegate
            {
                viewModel.OnRequestClose -= handler;
                window.Close();
            };

            viewModel.OnRequestClose += handler;

            window.Show();                                  
        }
    }
}
